<template>
  <van-swipe :autoplay="2500" indicator-color="white" class="detai-swiper">
    <van-swipe-item v-for="t in topSwiper" :key="t">
      <!-- 监听轮播图片的加载 -->
      <img :src="t" alt=""  />
    </van-swipe-item>
  </van-swipe>
</template>

<script>
import { Swipe, SwipeItem } from 'vant'

export default {
  props: {
    topSwiper: {
      type: Array,
      default () {
        return []
      }
    }
  },
  data () {
    return {
      isLoda: false
    }
  },
  watch: {},
  methods: {
    // imgSucLoad () {
    //   if (!this.isSwiper) {
    //     // console.log('轮播图加载完毕')
    //     this.$emit('swiperLoad')
    //     this.isSwiper = true
    //   }
    // }
  },
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem
  }
}
</script>

<style lang="less" scoped>
.detai-swiper {
  height: 400px;

  img {
    width: 100%;
  }
}
</style>
